import { BTResult } from "./BTEnum";
import BTNode from "./BTNode";

export default class BTDecoratorNode extends BTNode {
    protected child: BTNode;
    constructor(child: BTNode) {
        super();
        this.child = child;
    }

    start() {
        this.child.start();
    }
    
    update() {
        return this.decorator(this.child.update());
    }

    end() {
        this.child.end();
    }

    protected decorator(result: BTResult) {
        return result;
    }
}
